"use client";
import Login from "@/app/components/Login";
import { useCommonStore } from "@/src/providers/common-store-provider";

const Index = ({ children, needLogin }) => {
  const { showLogin } = useCommonStore((state) => state);
  if (needLogin) {
    return <Login needReload={true}></Login>;
  } else if (showLogin) {
    return <Login>{children}</Login>;
  }

  return <>{children}</>;
};
export default Index;
